package com.rcc.configuration;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;

/**
 * Created by rcc on 2017/6/23.
 * 项目入口
 */

@SpringBootApplication
@ComponentScan(basePackages = "com.rcc")
public class Entry extends SpringBootServletInitializer {
    public static void main(String[] args) throws Exception {
        SpringApplication.run(Entry.class, args);
    }
    /**
     * 如果要发布到自己的Tomcat中的时候，需要继承SpringBootServletInitializer类，并且增加如下的configure方法。
     * 如果不发布到自己的Tomcat中的时候，就无需上述的步骤
     */
    protected SpringApplicationBuilder configure(
            SpringApplicationBuilder application) {
        return application.sources(Entry.class);
    }

}
